package com.atguigu.springcloud.service.impl;

import com.atguigu.springcloud.entity.Payment;
import com.atguigu.springcloud.mapper.PaymentMapper;
import com.atguigu.springcloud.service.PaymentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cdd
 * @since 2021-03-08
 */
@Service
public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, Payment> implements PaymentService {

    @Override
    public Long create(Payment payment) {
        Payment paymentInsert = new Payment();
        BeanUtils.copyProperties(payment, paymentInsert);
        int insert = baseMapper.insert(paymentInsert);
        Long paymentId = paymentInsert.getId();
        return paymentId;
    }
}
